package calender;/**
 * @Author wxc
 * @Date 2021/4/23 10:51
 */

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author wxc
 * @date 2021年04月23日 10:51
 */
public class StreamDemo {
    public static void main(String[] args) {
        toDoFilter();
    }

    /**
     * @author wxc
     * @date 2021/4/23 10:52
     *
     * produce:
     */
    private static void toDoFilter() {
        List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
        List<String> filtered = strings.stream().filter(string -> !string.isEmpty()).collect(Collectors.toList());
        for (String s : filtered) {
            System.out.println(s);
        }
        filtered.forEach(System.out::println);
    }
}
